<!doctype html>
<html>
  <head>
    <title>Test Page for jquery.timeout</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.timeout.js"></script>
  </head>
  <body>
    <p>
      <p><span id="text1">Waiting...</span> <input id="clear1" type="button" value="Stop"></p>
      <p><span id="text2">Waiting...</span> <input id="clear2" type="button" value="Stop"></p>
      <p><span id="text3">Waiting...</span> <input id="clear3" type="button" value="Stop"></p>
    </p>
    <script type="text/javascript">
      function callback($elem, msg) {
        $elem.text(msg);
      }

      t1 = $.timeout(1000, $("#text1"), "1 second timeout").always(callback);
      t2 = $.timeout(2000, $("#text2"), "2 second timeout").always(callback);
      t3 = $.timeout(3000, $("#text3"), "3 second timeout").always(callback);

      $("#clear1").click(function() { t1.clear($("#text1"), "cleared"); });
      $("#clear2").click(function() { t2.clear($("#text2"), "cleared"); });
      $("#clear3").click(function() { t3.clear($("#text3"), "cleared"); });
    </script>
  </body>
</html>
